<template>
    <Transition name="down">
        <div class="xtx-message" v-show="modalVisible">
            <div class="letter-wrap">
                <div class="close-btn" @click="handleClose"></div>
                <img src="@/assets/img/console/show-letter.png" alt="">
            </div>

        </div>
    </Transition>
</template>
<script setup>
import { defineProps, defineEmits, computed } from 'vue';
import dbUtils from "libs/util.strotage";

const props = defineProps({
    modelValue: {
        type: Boolean,
        default: false
    },
});

const emit = defineEmits(['update:modelValue']);
const modalVisible = computed({
    get: () => props.modelValue,
    set: v => emit('update:modelValue', v),
});

const handleClose = () => {
    dbUtils.set('showLetter', false)
    emit('update:modelValue', false)
}
</script>
<style scoped lang="less">
.down {
    &-enter {
        &-from {
            transform: translate3d(0, -75px, 0);
            // opacity: 0;
        }

        &-active {
            transition: all 0.5s;
        }

        &-to {
            transform: none;
            opacity: 1;
        }
    }
}

.xtx-message {
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #999;
    border-radius: 4px;

    .letter-wrap {
        position: relative;

        .close-btn {
            position: absolute;
            top: 2.2%;
            right: 7.8%;
            width: 1.1vw;
            height: 1.1vw;
        }
    }

    img {
        height: 85vh;
    }

    .close-icon {
        position: absolute;
        width: 16px;
        height: 16px;
        right: 16%;
        top: 8.5%;
    }
}
</style>